<?php $this->load->view('navmenu');?>
<script type="text/javascript" charset="utf-8">
    // dynamic table
jQuery(document).ready(function(){
	
    jQuery('#dyntable').dataTable({
    "sPaginationType": "full_numbers",
    "aaSortingFixed": [[0,'asc']],
    "fnDrawCallback": function(oSettings) {
    jQuery.uniform.update();
    }
    });
});
        
</script>
<div class="maincontent">
        	<div class="contentinner">
                	<center><?php echo $this->session->flashdata('msg'); ?></center>
             <h4 class="widgettitle nomargin shadowed">Tambah CCO</h4>
                <div class="widgetcontent bordered shadowed nopadding">
                    <form class="stdform stdform2" method="post" action="<?php echo base_url()?>index.php/cco/saveCCO" enctype="multipart/form-data">
				<?php
				if($selectedCCO!="")
				{
					echo "<input type='hidden' name='id_cco' value='".$selectedCCO['id_cco']."'>";
				}
				?>
			    <p>
                                <label>NO MC</label>
                                <span class="field"><input type="text" name="no_mc" class="input-xlarge" <?php if($selectedCCO != ""){ echo 'value="'.$selectedCCO['no_mc'].'"'; }?>/></span>
                            </p>
							
			    <p>
                                <label>NO CCO</label>
                                <span class="field"><input type="text" name="no_cco" class="input-xlarge" <?php if($selectedCCO != ""){ echo 'value="'.$selectedCCO['nomor_cco'].'"'; }?>/></span>
                            </p>
							
			    <p>
                                <label>Pay Item</label>
                                <span class="field"><input type="text" name="pay_item" class="input-xlarge" <?php if($selectedCCO != ""){ echo 'value="'.$selectedCCO['pay_item'].'"'; }?>/></span>
                            </p>
			    
			    
			    <p>
                                <label>Jumlah</label>
                                <span class="field"><input type="text" id="jumlah" name="jumlah" class="input-xlarge" <?php if($selectedCCO != ""){ echo 'value="'.$selectedCCO['jumlah'].'"'; }?>/></span>
                            </p>
			    
			    <p>
                                <label>Harga Satuan</label>
                                <span class="field"><input type="text" id="harga" name="harga_satuan" class="input-xlarge" <?php if($selectedCCO != ""){ echo 'value="'.$selectedCCO['harga_satuan'].'"'; }?>/></span>
                            </p>   
							
			    <p>
                                <label>File CCO</label>
                                <span class="field"><input type="file" id="cco_file" name="cco_file" class="input-xlarge" style="padding-bottom: 0px;"/></span>
                            </p>
			    
			    <p>
                                <label>Total Biaya</label>
                                <span class="field"><input readonly type="text" id="total" class="input-xlarge"/></span>
                            </p>
							
				<p>
                                <label>Keterangan</label>
                                <span class="field"><textarea name="keterangan" class="input-xlarge"><?php if($selectedCCO != ""){ echo $selectedCCO['keterangan']; }?></textarea></span>
                            </p>
                                                    
                            <p class="stdformbutton">
                                <button type="submit" class="btn btn-primary">Submit Button</button>
                                <button type="reset" class="btn">Reset Button</button>
                            </p>
                        </form>
                    </div><!--widgetcontent-->
            	<h4 class="widgettitle">Daftar CCO</h4>
            	<table class="table table-bordered" id="dyntable">
                    <thead>
                        <tr>
                            <th class="center">No</th>
                            <th class="center">No MC</th>
                            <th class="center">No CCO</th>
                            <th class="center">Tanggal CCO</th>
                            <th class="center">Pay Item</th>
                            <th class="center">Description</th>
                            <th class="center">Unit</th>
                            <th class="center">Quantity</th>
                            <th class="center">Unit Price</th>
                            <th class="center">Total Biaya</th>
                            <th class="center">Quantity</th>
                            <th class="center">Unit Price</th>
                            <th class="center">Total Biaya</th>
                            <th class="center">Keterangan</th>
                            <th class="center">Action</th>
                        </tr>
                    </thead>
                    <tbody>
					<?php $i=1;?>
					<?php foreach($cco as $row):?>
                        <tr class="gradeX">
                            <td class="center"><?=$i?></td>
                            <td class="center"><?=$row['no_mc']?></td>
                            <td class="center"><?=$row['nomor_cco']?></td>
                            <td class="center"><?=$row['tanggal_cco']?></td>
                            <td class="center"><?=$row['pay_item']?></td>
                            <td class="center"><?=$row['uraian']?></td>
                            <td class="center"><?=$row['satuan']?></td>
                            <td class="center"><?=$row['boqJumlah']?></td>
                            <td class="center"><?=$row['boqHargaSatuan']?></td>
                            <td class="center"><?=$row['boqJumlah']*$row['boqHargaSatuan']?></td>
                            <td class="center"><?=$row['jumlah']?></td>
                            <td class="center"><?=$row['harga_satuan']?></td>
                            <td class="center"><?=$row['jumlah']*$row['harga_satuan']?></td>							
                            <td class="center"><?=$row['keterangan']?></td>
                            <td class="center"><a href="<?php echo base_url();?>index.php/cco/ccoList/<?=$row['id_cco']?>"/><i class="icon-edit"></i></a> | <a href="<?php echo base_url();?>index.php/cco/deleteCCO/<?=$row['id_cco']?>"><i class="icon-remove"></i></a></td>
                        </tr>
					<?php $i++;endforeach; ?>
                    </tbody>
                </table>
       
            </div><!--contentinner-->
        </div><!--maincontent-->